<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <!-- 引用vue3的源码 -->
    <script src="https://unpkg.com/vue@next"></script>
</head>
<body>
    <div class="app"></div>
    
</body>
<script>
    const app = Vue.createApp({
        data() {
            return {
               show:false
            }
        },
        //show是通过display none来隐藏
        //if是通过注释掉来隐藏，下次显示需要重新渲染
        //如果频繁切换显示隐藏，建议用show，可以避免重复渲染
        template:`
            <h2 v-show='show'>jspang.com</h2>
            <h2 v-if='show'>jspang.com</h2>
        `
    })
    const vm = app.mount('.app')
</script>

</html>